/**
 *
 */
package asa;

/**
 * 	EnquantoStat ::= "enquanto" Expr "faça"
                       		StatList

 * @author José
 *
 */
public class EnquantoStat extends Statement {

	public EnquantoStat(Expr expr, CompositeStatement compositeStatement) {
		this.expr = expr;
		this.compositeStatement = compositeStatement;
	}

	/* (non-Javadoc)
	 * @see asa.Statement#genC(asa.PW)
	 */
	@Override
	public void genJava(PWInterface pw) {
		genJava(pw, null);
	}

	/* (non-Javadoc)
	 * @see asa.Statement#genC(asa.PW)
	 */
	@Override
	public void genJava(PWInterface pw, Env env) {
		// TODO Auto-generated method stub
		pw.printIdent("while (");
		expr.genJava(pw);
		pw.print(") ");
		compositeStatement.genJava(pw, null);
	}

	private Expr expr;
	private CompositeStatement compositeStatement;

}
